package cn.edu.buaa.cnsatm.traffic_big_data_server.aviation.controller;

import cn.edu.buaa.cnsatm.traffic_big_data_server.aviation.service.AirportService;
import cn.edu.buaa.cnsatm.traffic_big_data_server.highway.model.ImageService;
import org.joda.time.DateTime;
import org.springframework.web.bind.annotation.*;

import java.sql.SQLException;


@CrossOrigin
@RestController
public class AirportController {

    /**
     * @param
     * @return String
     * @author CHEN LI
     * @description 返回航空气象影响
     * @since 2019-10-19
     */
    @RequestMapping("/airportWeatherEffects")
    public static String airportWeatherEffects(
            @RequestParam(value = "top_num",required = true,defaultValue = "6")String top_num
    ){
        return AirportService.getAirportWeatherEffects(top_num);
    }
    @RequestMapping("/cloudImage")
    @ResponseBody
    public String webGetLatestRoadWeatherImage(
    ) throws SQLException {
        /**
         * @author LX
         * @return 见接口文档
         * @description 返回最新的云图
         * @since 2019-10-29
         */
        //System.out.println("hello");
        return ImageService.getNewestImageByImageType("cloud");
    }
}
